package com.ys.controller.web.sys;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import com.bo.vo.W;
import com.ys.entity.sys.TbStaticConfig;
import com.ys.service.sys.CommonApiService;

@Controller
@RequestMapping("/web/sys/tbStaticConfig")
public class WebTbStaticConfigController {
	
	public static Long MENU_ID = 122L;
	
	@Autowired
	private CommonApiService<TbStaticConfig> commonService;
	
	/**
	 * 
	 */
	@GetMapping("/toAdd")
	public String toAdd(Model model){

		try {
			return commonService.toAdd(model, new TbStaticConfig(), MENU_ID, null, null);
		} catch (Exception e) {
			e.printStackTrace();
			return W.error(model, e.getMessage());
		}
	}
	
	/*
	 * 编辑页
	 */
	@GetMapping("/toEdit")
	public String toEdit(Model model,
			Long id){

		try {
			return commonService.toEdit(model, id, new TbStaticConfig(), MENU_ID, null, null);
		} catch (Exception e) {
			e.printStackTrace();
			return W.error(model, e.getMessage());
		}
	}
}
